<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoldSeedsTable extends Migration
{
    public function up()
    {
        Schema::create('gold_seeds', function (Blueprint $table) {
	        $table->id();
	        $table->string('title')->nullable()->index();
	        $table->unsignedBigInteger('product_id')->default(0)->index();
	        $table->unsignedInteger('all_rounds')->default(6);

	        $table->decimal('init_price', 10, 2)->default(0);

            $table->unsignedBigInteger('split_gold_round_id')->default(0)->index();
            $table->unsignedInteger('split_amount')->default(3);

	        $table->timestamps();
	        $table->index(['created_at']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('gold_seeds');
    }
}
